package com.ssm.service;

import com.ssm.dao.UserMapper;
import com.ssm.model.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.sql.SQLException;

@Transactional
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    public User findUserById(String id) throws SQLException {
        return userMapper.selectByPrimaryKey(id);
    }

    public void addUser(User user) throws SQLException {
        userMapper.insert(user);
    }
}
